document.addEventListener("DOMContentLoaded", function() {
    const container = document.querySelector('.container');
    const raindrops = document.querySelectorAll('.raindrop');

    let lefts = Array.from({length: raindrops.length}).map(i => {

    });
    raindrops.forEach((drop, index) => {
        const curr = Math.random() * 80;

        drop.style.left = `${curr}%`; // Adjusted to prevent raindrops from going off-screen
        drop.style.animationDelay = `${index * 0.5 + 0.5}s`; // Ensure sequential falling, no delay for first drop
    });

    function createRaindrop(content, delay) {
        const drop = document.createElement('div');
        drop.className = 'raindrop';
        drop.innerText = content;
        drop.style.left = `${Math.random() * 80 + 10}%`; // Adjusted to prevent raindrops from going off-screen
        drop.style.animationDelay = `${delay}s`; // Custom delay for new drops
        container.appendChild(drop);
    }

    // // 示例：添加更多的随笔内容
    // createRaindrop(raindrops.length * 2);
    // createRaindrop((raindrops.length + 1) * 2);
});


